package com.yztstudy.clients;

import com.yztstudy.clients.impl.SearchHystrixImpl;
import com.yztstudy.param.ProductSearchParam;
import com.yztstudy.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 搜索服务的远程调用接口
 */

@FeignClient(value = "search-service", fallback = SearchHystrixImpl.class)
public interface SearchFeignClient {

    /**
     * TODO 分页 + 分词 的商品搜索
     * @param productSearchParam 搜索参数
     * @return
     */
    @PostMapping("/search/product")
    public R searchProduct(@RequestBody ProductSearchParam productSearchParam);
}
